A layer 2 network loop brings many problems to a normal network, for example, a broadcast storm and a media access control (MAC) address learning error. A direct result of a broadcast storm is invalid occupation of a network bandwidth and a resource such as a central processing unit (CPU) and a memory of a network device. A direct result of a MAC address learning error is that a same MAC address flaps among multiple ports, leading to a forwarding error of layer 2 traffic. Therefore, a layer 2 loop prevention protocol is commonly used in a current metropolitan area network to protect a service. The so-called loop prevention indicates that a ring is changed to a link on a layer 2 Ethernet network to prevent a loop. Loop prevention protocols mostly used in current service protection include a rapid ring protection protocol (RRPP) and a spanning tree protocol (STP), where the STP is further classified into a multiple spanning tree protocol (MSTP) and a rapid spanning tree protocol (RSTP).
The RRPP is a link layer protocol specially applied to an Ethernet ring, and is capable of preventing a broadcast storm caused by a loop on the Ethernet ring. When a link on the Ethernet ring is disconnected, the RRPP is capable of rapidly starting a backup link to restore a communication path among nodes on the ring network. RRPP convergence time is irrelevant to the number of nodes on the ring network, a convergence speed is fast, and the RRPP convergence time is less than 50 ms. However, the RRPP applies only to a simple network topology, such as a single ring topology or an intersecting ring topology that has only two intersecting points, and does not apply to a relatively complex network topology.
The STP selectively blocks a redundant link on a network to achieve an objective of removing a network layer 2 loop, and meanwhile, has a link backup function. The RSTP introduces a port state negotiation mechanism, so that topology convergence time may be within 3 s. The MSTP has characteristics of both the STP and the RSTP, and can apply to all network topology situations. However, the topology convergence speeds of the RSTP and the MSTP are too slow. When the RSTP or the MSTP is used in the metropolitan area network to perform packet processing, packet processing interruption time is too long.